********************************************************************************
*REPLICATION CODE FOR: Red Lines versus Negotiables: How Exposure to Wartime Violence Influences Support for Peace Settlements in Ukraine

*Consists of
*-generating new variables for the analysis (lines 23-101)
*-replicating main text figures (lines 104-476)
*-replicating appendix tables and figures (lines 479-1624)
********************************************************************************

clear
set more off
eststo clear


*Set directory
*First, please change your directory (using the command cd) to the folder where you save the datasets.


log using RedLines_Replication, replace

use "RedLines_dataset.dta"

********************************************************************************
*Generating additional variables for analysis
********************************************************************************

gen baseline_support=q30 if wave==1 | wave==2&online==1
	replace baseline_support=q1_experiment if wave==2&telephone==1
	
	replace baseline_support=. if baseline_support>10
	replace baseline_support=baseline_support/10
	
gen poison_pill=.
	replace poison_pill=1 if q30_1!=. & wave==1 | q30_1!=. & wave==2&online==1
	replace poison_pill=2 if q30_2!=. & wave==1 | q30_2!=. & wave==2&online==1
	replace poison_pill=3 if q30_3!=. & wave==1 | q30_3!=. & wave==2&online==1
	replace poison_pill=4 if q30_4!=. & wave==1 | q30_4!=. & wave==2&online==1
	
	replace poison_pill=1 if sample_q2==1 & wave==2&telephone==1
	replace poison_pill=2 if sample_q2==2 & wave==2&telephone==1
	replace poison_pill=3 if sample_q2==3 & wave==2&telephone==1
	replace poison_pill=4 if sample_q2==4 & wave==2&telephone==1
	
	label define poison_pill_lab 1 "Zelensky resigns" 2 "Crimea recognized as Russia" 3 "Let LNR/DNR vote" 4 "Never join EU"
label values poison_pill poison_pill_lab
	
gen postpoison_support=q30_1 if poison_pill==1 & wave==1 | poison_pill==1 & wave==2 &online==1
	replace postpoison_support=q30_2 if poison_pill==2 & wave==1 | poison_pill==2 & wave==2 &online==1
	replace postpoison_support=q30_3 if poison_pill==3 & wave==1 | poison_pill==3 & wave==2 &online==1
	replace postpoison_support=q30_4 if poison_pill==4	& wave==1 | poison_pill==4 & wave==2 &online==1
	replace postpoison_support=q2 if wave==2&telephone==1
	
	replace postpoison_support=. if postpoison_support>10
	replace postpoison_support=postpoison_support/10
	
gen delta_support=postpoison_support-baseline_support

bys wave online: sum delta_support
bys wave online: sum baseline_support


sum pca_violexposure, de
gen above_med_expos=0
	replace above_med_expos=1 if pca_violexposure>=-.37 & wave==1 |  pca_violexposure>=-.37 & wave==2 & online==1
	replace above_med_expos=. if pca_violexposure==. & wave==1 |  pca_violexposure==. & wave==2 & online==1

sum gunfire_exposure_norm if wave==2&telephone==1, de
*Median=0
	replace above_med_expos=1 if gunfire_exposure_norm>0 & wave==2&telephone==1
	replace above_med_expos=0 if gunfire_exposure_norm<=0 & wave==2&telephone==1
	replace above_med_expos=. if gunfire_exposure_norm==. & wave==2&telephone==1

	tab above_med_expos,m


*Does military optimism drive lower baseline support for agreement in the 
*poison pill experiment? Comparing online wave 1 and telephone wave 1 using
*military optimism on RHS

*Rescale 


foreach v in milsuccess_q10 milsuccess_q11 milsuccess_q12 milsuccess_q13{
	numlabel `v', add
	tab `v'
}

gen milsuccess_q9_norm=milsuccess_q9 if milsuccess_q9<=10
	replace milsuccess_q9_norm=(milsuccess_q9_norm)/10

gen milsuccess_q10_norm=milsuccess_q10 if milsuccess_q10<=10
	replace milsuccess_q10_norm=(milsuccess_q10_norm)/10

gen milsuccess_q11_norm=milsuccess_q11 if milsuccess_q11<=10
replace milsuccess_q11_norm=(milsuccess_q11_norm)/10

gen milsuccess_q12_norm=milsuccess_q12 if milsuccess_q12<=10
replace milsuccess_q12_norm=(milsuccess_q12_norm)/10

gen milsuccess_q13_norm=milsuccess_q13 if milsuccess_q13<=10
replace milsuccess_q13_norm=(milsuccess_q13_norm)/10
	

********************************************************************************
*Replicating main text figures
********************************************************************************


***FIGURE 4: Experimental primes influence public support for settlements


matrix survey_matrix = J(15,4,.)
	
summarize baseline_support if wave==1 & online==1, detail

matrix survey_matrix[1,1] = 1
matrix survey_matrix[1,2] = r(mean)
matrix survey_matrix[1,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[1,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize postpoison_support if poison_pill==3 & wave==1 & online==1, detail

matrix survey_matrix[2,1] = 1.25
matrix survey_matrix[2,2] = r(mean)
matrix survey_matrix[2,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[2,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize postpoison_support if poison_pill==1 &wave==1 & online==1, detail

matrix survey_matrix[3,1] = 1.5
matrix survey_matrix[3,2] = r(mean)
matrix survey_matrix[3,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[3,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize postpoison_support if poison_pill==2&wave==1 & online==1, detail

matrix survey_matrix[4,1] = 1.75
matrix survey_matrix[4,2] = r(mean)
matrix survey_matrix[4,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[4,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize postpoison_support if poison_pill==4&wave==1 & online==1, detail

matrix survey_matrix[5,1] = 2
matrix survey_matrix[5,2] = r(mean)
matrix survey_matrix[5,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[5,4] = r(mean)+1.96*r(sd)/sqrt(r(N))


summarize baseline_support if wave==1 & online==0, detail

matrix survey_matrix[6,1] = 2.5
matrix survey_matrix[6,2] = r(mean)
matrix survey_matrix[6,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[6,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize postpoison_support if poison_pill==3&wave==1 & online==0, detail

matrix survey_matrix[7,1] = 2.75
matrix survey_matrix[7,2] = r(mean)
matrix survey_matrix[7,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[7,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize postpoison_support if poison_pill==1&wave==1 & online==0, detail

matrix survey_matrix[8,1] = 3
matrix survey_matrix[8,2] = r(mean)
matrix survey_matrix[8,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[8,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize postpoison_support if poison_pill==2&wave==1 & online==0, detail

matrix survey_matrix[9,1] = 3.25
matrix survey_matrix[9,2] = r(mean)
matrix survey_matrix[9,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[9,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize postpoison_support if poison_pill==4&wave==1 & online==0, detail

matrix survey_matrix[10,1] = 3.5
matrix survey_matrix[10,2] = r(mean)
matrix survey_matrix[10,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[10,4] = r(mean)+1.96*r(sd)/sqrt(r(N))


summarize baseline_support if wave==2 & online==0, detail

matrix survey_matrix[11,1] = 4
matrix survey_matrix[11,2] = r(mean)
matrix survey_matrix[11,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[11,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize postpoison_support if poison_pill==3&wave==2 & online==0, detail

matrix survey_matrix[12,1] = 4.25
matrix survey_matrix[12,2] = r(mean)
matrix survey_matrix[12,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[12,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize postpoison_support if poison_pill==1&wave==2 & online==0, detail

matrix survey_matrix[13,1] = 4.5
matrix survey_matrix[13,2] = r(mean)
matrix survey_matrix[13,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[13,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize postpoison_support if poison_pill==2&wave==2 & online==0, detail

matrix survey_matrix[14,1] = 4.75
matrix survey_matrix[14,2] = r(mean)
matrix survey_matrix[14,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[14,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize postpoison_support if poison_pill==4&wave==2 & online==0, detail

matrix survey_matrix[15,1] = 5
matrix survey_matrix[15,2] = r(mean)
matrix survey_matrix[15,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[15,4] = r(mean)+1.96*r(sd)/sqrt(r(N))


svmat survey_matrix, names(sm_)

tw (pccapsym sm_3 sm_1 sm_4 sm_1, msymbol(point)) (scatter sm_2 sm_1 if sm_1==1 | sm_1==2.5 | sm_1==4, msymbol(O)) (scatter sm_2 sm_1 if sm_1==1.25 | sm_1==2.75 | sm_1==4.25, msymbol(dh)) (scatter sm_2 sm_1 if sm_1==1.5 | sm_1==3 | sm_1==4.5, msymbol(th)) (scatter sm_2 sm_1 if sm_1==1.75 | sm_1==3.25 | sm_1==4.75, msymbol(sh)) (scatter sm_2 sm_1 if sm_1==2 | sm_1==3.5 | sm_1==5, msymbol(oh)) ,  ///
	xtitle("Survey waves") ytitle("Public support for settlement") xlabel(1.5 "Wave 1 online (July 1-7, 2022)" 3 "Wave 1 phone (July 1-12, 2022)" 4.5 "Wave 3 phone (May 26 - June 5, 2023)", angle(45) labsize(small)) legend(order( 2 "Baseline" 3 "Let LNR/DNR vote" 4 "Zelensky resigns" 5 "Crimea recognized as Russia" 6 "Never join EU") position(2) bmargin(medium))

quietly graph export figure4.jpg, replace

drop sm_* 

	
***FIGURE 5: Percentage change in support for an agreement relative to the baseline

gen difference_in_support = postpoison_support - baseline_support
sum difference_in_support	

gen pct_change = (difference_in_support/baseline_support)*100
sum pct_change

bys wave online poison_pill: sum difference_in_support


matrix survey_matrix = J(12,4,.)
	
summarize pct_change if poison_pill==3 & wave==1 & online==1, detail
matrix survey_matrix[1,1] = 1
matrix survey_matrix[1,2] = r(mean)
matrix survey_matrix[1,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[1,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize pct_change if poison_pill==1 &wave==1 & online==1, detail
matrix survey_matrix[2,1] = 1.25
matrix survey_matrix[2,2] = r(mean)
matrix survey_matrix[2,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[2,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize pct_change if poison_pill==2&wave==1 & online==1, detail
matrix survey_matrix[3,1] = 1.5
matrix survey_matrix[3,2] = r(mean)
matrix survey_matrix[3,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[3,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize pct_change if poison_pill==4&wave==1 & online==1, detail
matrix survey_matrix[4,1] = 1.75
matrix survey_matrix[4,2] = r(mean)
matrix survey_matrix[4,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[4,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize pct_change if poison_pill==3&wave==1 & online==0, detail
matrix survey_matrix[5,1] = 2.25
matrix survey_matrix[5,2] = r(mean)
matrix survey_matrix[5,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[5,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize pct_change if poison_pill==1&wave==1 & online==0, detail
matrix survey_matrix[6,1] = 2.5
matrix survey_matrix[6,2] = r(mean)
matrix survey_matrix[6,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[6,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize pct_change if poison_pill==2&wave==1 & online==0, detail
matrix survey_matrix[7,1] = 2.75
matrix survey_matrix[7,2] = r(mean)
matrix survey_matrix[7,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[7,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize pct_change if poison_pill==4&wave==1 & online==0, detail
matrix survey_matrix[8,1] = 3
matrix survey_matrix[8,2] = r(mean)
matrix survey_matrix[8,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[8,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize pct_change if poison_pill==3&wave==2 & online==0, detail
matrix survey_matrix[9,1] = 3.5
matrix survey_matrix[9,2] = r(mean)
matrix survey_matrix[9,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[9,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize pct_change if poison_pill==1&wave==2 & online==0, detail
matrix survey_matrix[10,1] = 3.75
matrix survey_matrix[10,2] = r(mean)
matrix survey_matrix[10,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[10,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize pct_change if poison_pill==2&wave==2 & online==0, detail
matrix survey_matrix[11,1] = 4
matrix survey_matrix[11,2] = r(mean)
matrix survey_matrix[11,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[11,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize pct_change if poison_pill==4&wave==2 & online==0, detail
matrix survey_matrix[12,1] = 4.25
matrix survey_matrix[12,2] = r(mean)
matrix survey_matrix[12,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[12,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

svmat survey_matrix, names(sm_)

tw (pccapsym sm_3 sm_1 sm_4 sm_1, msymbol(point)) (scatter sm_2 sm_1 if sm_1==1 | sm_1==2.25 | sm_1==3.5, msymbol(O)) (scatter sm_2 sm_1 if sm_1==1.25 | sm_1==2.5 | sm_1==3.75, msymbol(dh)) (scatter sm_2 sm_1 if sm_1==1.5 | sm_1==2.75 | sm_1==4, msymbol(th)) (scatter sm_2 sm_1 if sm_1==1.75 | sm_1==3 | sm_1==4.25, msymbol(sh)) ,  ///
	xtitle("Survey waves", size(small)) ytitle("% change relative to baseline support", size(small)) xlabel(1.37 "Wave 1 online (July 1-7, 2022)" 2.62 "Wave 1 phone (July 1-12, 2022)" 3.87 "Wave 3 phone (May 26 - June 5, 2023)", angle(45) labsize(small))  ylabel(-20 "-20%" -30 "-30%" -40 "-40%" -50 "-50%" -60 "-60%" -70 "-70%" -80 "-80%" , angle(0) labsize(small)) legend(order( 2 "Let LNR/DNR vote" 3 "Zelensky resigns" 4 "Crimea recognized as Russia" 5 "Never join EU") position(2) bmargin(medium))
	
quietly graph export figure5.jpg, replace

drop sm_* 
	
	
***FIGURE 6: First-difference estimates of relationship between violence exposure and attitudes, online panel

*6a: REGRESSING PRINCIPLES OF NEGOTIATION FD ON PCA OF VIOLENCE EXPOSURE
	
foreach v in fd_pca_principlesneg0_1 fd_q13_norm0_1 fd_q14_norm0_1 fd_q15_norm0_1 fd_q16_norm0_1 fd_q17_norm0_1 fd_q18_norm0_1 fd_q19_norm0_1 fd_q20_norm0_1{
	eststo m`v': reghdfe `v' fd_pca_violexposure0_1, a(oblast_lag) vce(cluster oblast_lag)
	esttab, beta not 
}
	
coefplot m*, drop(_cons) vertical yline(0, lcolor(red)) levels(95 90) legend(off) ///
coeflabels(mfd_pca_principlesneg0_1= "PCA principles of neg., FD" mfd_q13_norm0_1= "UKR shouldn't negotiate, FD" mfd_q14_norm0_1= "Morally wrong to sell out, FD" mfd_q15_norm0_1= "RUS cannot be trusted, FD" mfd_q16_norm0_1= "RUS will exploit peace, FD" mfd_q17_norm0_1= "Peace is morally right, FD" mfd_q18_norm0_1= "UKR must make peace, FD" mfd_q19_norm0_1= "UKR must make terr. concessions, FD" mfd_q20_norm0_1= "Strategic to keep negotiating, FD", labsize(vsmall) angle(45)) aseq swapnames

quietly graph export figure6a.jpg, replace

eststo clear


*6b: REGRESSING PEACE TERMS PCA FD ON PCA OF VIOLENCE EXPOSURE


foreach v in fd_pca_peacecomp0_1 fd_q21_norm0_1 fd_q22_norm0_1 fd_q23_norm0_1 fd_q24_norm0_1 fd_q25_norm0_1 fd_q26_norm0_1 fd_q27_norm0_1 fd_q28_norm0_1 fd_q29_norm0_1{
	eststo m`v': reghdfe `v' fd_pca_violexposure0_1, a(oblast_lag) vce(cluster oblast_lag)
}
	
coefplot m*, drop(_cons) vertical yline(0, lcolor(red)) levels(95 90) coeflabels(mfd_pca_peacecomp0_1="PCA peace components, FD" mfd_q21_norm0_1 = "UKR shouldn't join NATO, FD" mfd_q22_norm0_1 = "Western security guarantees, FD" mfd_q23_norm0_1 = "Russian as official language, FD" mfd_q24_norm0_1 = "Crimea as part of Russia, FD" mfd_q25_norm0_1 = "Independent DNR/LNR, FD" mfd_q26_norm0_1 = "Reduce UKR army size, FD" mfd_q27_norm0_1="Voting by DNR/LNR, FD" mfd_q28_norm0_1="UKR reject joining EU, FD" mfd_q29_norm0_1="Zelensky stepping down, FD",  labsize(vsmall) angle(45)) legend(off) aseq swapnames

quietly graph export figure6b.jpg, replace

eststo clear


***FIGURE 7: First-difference estimates of relationship between violence exposure and attitudes, online panel

*7a: REGRESSING `STRATEGIC TO KEEP NEGOTIATING' ON COMPONENTS OF VIOLENCE EXPOSURE
rename fd_shelterinplace_exposure0_1 fd_shelterinplace_exp0_1

foreach v in fd_pca_violexposure0_1 fd_shelling_exposure0_1 fd_bombsiren_exposure0_1 fd_gunfire_exposure0_1 fd_shelterinplace_exp0_1 fd_bombshelter_exposure0_1 fd_vizwounded_exposure0_1 {
	eststo m`v': reghdfe fd_q20_norm `v', a(oblast_lag) vce(cluster oblast_lag)
}

coefplot m*, drop(_cons) vertical yline(0, lcolor(red) lpattern(dash)) levels(95 90) coeflabels(fd_pca_violexposure0_1 = "PCA viol expos, FD" fd_shelling_exposure0_1 = "Shelling, FD" fd_bombsiren_exposure0_1 = "Siren, FD" fd_gunfire_exposure0_1 = "Gunfire, FD"  fd_shelterinplace_exp0_1 = "Sheltering, FD" fd_bombshelter_exposure0_1 = "Bomb shelter, FD" fd_vizwounded_exposure0_1 = "Seen wounded, FD",  labsize(small) angle(45)) legend(off) graphregion(color(white))

quietly graph export figure7a.jpg, replace

eststo clear 


*7b: REGRESSING `INDEPENDENT DNR/LNR' ON COMPONENTS OF VIOLENCE EXPOSURE

foreach v in fd_pca_violexposure0_1 fd_shelling_exposure0_1 fd_bombsiren_exposure0_1 fd_gunfire_exposure0_1 fd_shelterinplace_exp0_1 fd_bombshelter_exposure0_1 fd_vizwounded_exposure0_1{
	eststo m`v': reghdfe fd_q25_norm `v', a(oblast_lag) vce(cluster oblast_lag)
}

coefplot m*, drop(_cons) vertical yline(0, lcolor(red) lpattern(dash)) levels(95 90) coeflabels(fd_pca_violexposure0_1 = "PCA viol expos, FD" fd_shelling_exposure0_1 = "Shelling, FD" fd_bombsiren_exposure0_1 = "Siren, FD" fd_gunfire_exposure0_1 = "Gunfire, FD" fd_shelterinplace_exp0_1 = "Sheltering, FD" fd_bombshelter_exposure0_1 = "Bomb shelter, FD" fd_vizwounded_exposure0_1 = "Seen wounded, FD",  labsize(small) angle(45)) legend(off) graphregion(color(white))

quietly graph export figure7b.jpg, replace

eststo clear 


***FIGURE 8: First-difference estimates of relationship between violence exposure and attitudes, online panel

*8a: REGRESSING `REDUCING UKRAINE'S ARMY' ON COMPONENTS OF VIOLENCE EXPOSURE

foreach v in fd_pca_violexposure0_1 fd_shelling_exposure0_1 fd_bombsiren_exposure0_1 fd_gunfire_exposure0_1 fd_shelterinplace_exp0_1 fd_bombshelter_exposure0_1 fd_vizwounded_exposure0_1{
	eststo m`v': reghdfe fd_q26_norm `v', a(oblast_lag) vce(cluster oblast_lag)
}

coefplot m*, drop(_cons) vertical yline(0, lcolor(red) lpattern(dash)) levels(95 90) coeflabels(fd_pca_violexposure0_1 = "PCA viol expos, FD" fd_shelling_exposure0_1 = "Shelling, FD" fd_bombsiren_exposure0_1 = "Siren, FD" fd_gunfire_exposure0_1 = "Gunfire, FD" fd_shelterinplace_exp0_1 = "Sheltering, FD" fd_bombshelter_exposure0_1 = "Bomb shelter, FD" fd_vizwounded_exposure0_1 = "Seen wounded, FD", labsize(small) angle(45)) legend(off) graphregion(color(white))

quietly graph export figure8a.jpg, replace

eststo clear 

*8b: REGRESSING `UKRAINE REJECTS JOINING THE EU' ON COMPONENTS OF VIOLENCE EXPOSURE

foreach v in fd_pca_violexposure0_1 fd_shelling_exposure0_1 fd_bombsiren_exposure0_1 fd_gunfire_exposure0_1 fd_shelterinplace_exp0_1 fd_bombshelter_exposure0_1 fd_vizwounded_exposure0_1{
	eststo m`v': reghdfe fd_q28_norm `v', a(oblast_lag) vce(cluster oblast_lag)
}

coefplot m*, drop(_cons) vertical yline(0, lcolor(red) lpattern(dash)) levels(95 90) coeflabels(fd_pca_violexposure0_1 = "PCA viol expos, FD" fd_shelling_exposure0_1 = "Shelling, FD" fd_bombsiren_exposure0_1 = "Siren, FD" fd_gunfire_exposure0_1 = "Gunfire, FD" fd_shelterinplace_exp0_1 = "Sheltering, FD" fd_bombshelter_exposure0_1 = "Bomb shelter, FD" fd_vizwounded_exposure0_1 = "Seen wounded, FD", labsize(small) angle(45)) legend(off) graphregion(color(white))

quietly graph export figure8b.jpg, replace

eststo clear 


***FIGURE 9: Exposure to violence and level of support for an agreement (May 2023 survey)
*Use q3 and q4 in omnibus to examine whether having close family or friends that have..."
*Use above_median_expos (based on hearing gunfire) to examine exposure to violence

preserve

keep if telephone==1 & wave==2

tab q3 q4 
gen q3_new=q3
gen q4_new=q4

replace q3_new=. if q3_new==998 | q3_new==999 // RA or DK answers
replace q4_new=. if q4_new==998 | q4_new==999 // RA or DK answers

sum q3_new q4_new, de

gen above_med_exposure1=.
replace above_med_exposure1=0 if q3_new<3 & q3_new!=.
replace above_med_exposure1=1 if q3_new>=3 & q3_new!=.

gen above_med_exposure2=.
replace above_med_exposure2=0 if q4_new<2 & q4_new!=.
replace above_med_exposure2=1 if q4_new>=2 & q4_new!=.

eststo clear

eststo m1: reg baseline_support above_med_exposure1 female age3039 age4049 age5059 age6069 age70 higher_educ russian_speaker i.oblast_feb24, vce(cluster oblast_feb24)
eststo m2: reg baseline_support above_med_exposure2 female age3039 age4049 age5059 age6069 age70 higher_educ russian_speaker i.oblast_feb24, vce(cluster oblast_feb24)
eststo m3: reg baseline_supp above_med_expos female age3039 age4049 age5059 age6069 age70 higher_educ russian_speaker i.oblast_feb24, vce(cluster oblast_feb24)

coefplot (m1, msymbol(o) label(Injured family and friends)) (m2, msymbol(d) label(Killed family and friends)) (m3, msymbol(t) label(Heard gunfire)), ylabel(none) xline(0) title("Exposure to Violence and" "Baseline Support for Agreement" ) levels (95 90) keep (above_med_expos above_med_exposure1 above_med_exposure2)

quietly graph export figure9.jpg, replace

eststo clear

restore



***FIGURE 10: Military optimism and support for an agreement


*Military optimism variables (success due to skill of Ukraine's soldiers minus success due to the weakness of Russian army)
gen miloptimism = milsuccess_q9_norm-milsuccess_q13_norm
la var miloptimism "Military optimism"
sum miloptimism, de

gen above_median_miloptimism=.
replace above_median_miloptimism=0 if miloptimism<=0.3 & miloptimism!=.
replace above_median_miloptimism=1 if miloptimism>0.3 & miloptimism!=.
sum above_median_miloptimism


eststo m1: reg baseline_support above_median_miloptimism pca_violexposure0_1, vce(robust)
eststo m2: reghdfe baseline_support above_median_miloptimism pca_violexposure0_1 age, a(oblast_feb24 i.q2 i.q3 i.q4 i.q6 q7_1 q8_1 q8_2 q8_3 q8_4 q8_5 q8_7) vce(cluster oblast_feb24)

coefplot (m1, label(Baseline)) (m2, label(Saturated)), vertical keep(above_median_miloptimism) xlabel( ,angle(45))  levels(95 90) title("Support for settlement with Russia") xlabel(1 "Military optimism")

quietly graph export figure10.jpg, replace

eststo clear


********************************************************************************
*Replicating appendix figures
********************************************************************************


***TABLE A-1: Descriptive statistics

estpost sum age1829 age3039 age4049 age5059 age6069 age70 female higher_educ russian_speaker oblast_feb24_* if wave2==1
eststo m1

estpost sum age1829 age3039 age4049 age5059 age6069 age70 female higher_educ russian_speaker oblast_feb24_* if wave2==2
eststo m3

estpost sum age1829 age3039 age4049 age5059 age6069 age70 female higher_educ russian_speaker oblast_feb24_* if wave2==4
eststo m4

esttab m1 m3 m4 using table_a1.tex, replace mtitles("\textbf{\emph{Online}}" "\textbf{\emph{Telephone wave 1}}" "\textbf{\emph{Telephone wave 2}}") ///
collabels(\multicolumn{1}{c}{{Mean}} \multicolumn{1}{c}{{Std.Dev.}} \multicolumn{1}{l}{{N}}) /// 
cells("mean(fmt(2)) sd(fmt(2)) count(fmt(0))") label nonumber f noobs alignment(S) booktabs

eststo clear


***FIGURE A-4
*A-4a: Principles of negotiation


matrix survey_matrix = J(24,4,.)	
		
summarize q13_norm if wave==1 & online==1, detail
matrix survey_matrix[1,1] = 1
matrix survey_matrix[1,2] = r(mean)
matrix survey_matrix[1,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[1,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q13_norm if wave==2 & online==1, detail
matrix survey_matrix[2,1] = 1.25
matrix survey_matrix[2,2] = r(mean)
matrix survey_matrix[2,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[2,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q13_norm if wave==1 & online==0, detail
matrix survey_matrix[3,1] = 1.5
matrix survey_matrix[3,2] = r(mean)
matrix survey_matrix[3,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[3,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q14_norm if wave==1 & online==1, detail
matrix survey_matrix[4,1] = 2
matrix survey_matrix[4,2] = r(mean)
matrix survey_matrix[4,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[4,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q14_norm if wave==2 & online==1, detail
matrix survey_matrix[5,1] = 2.25
matrix survey_matrix[5,2] = r(mean)
matrix survey_matrix[5,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[5,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q14_norm if wave==1 & online==0, detail
matrix survey_matrix[6,1] = 2.5
matrix survey_matrix[6,2] = r(mean)
matrix survey_matrix[6,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[6,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q15_norm if wave==1 & online==1, detail
matrix survey_matrix[7,1] = 3
matrix survey_matrix[7,2] = r(mean)
matrix survey_matrix[7,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[7,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q15_norm if wave==2 & online==1, detail
matrix survey_matrix[8,1] = 3.25
matrix survey_matrix[8,2] = r(mean)
matrix survey_matrix[8,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[8,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q15_norm if wave==1 & online==0, detail
matrix survey_matrix[9,1] = 3.5
matrix survey_matrix[9,2] = r(mean)
matrix survey_matrix[9,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[9,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q16_norm if wave==1 & online==1, detail
matrix survey_matrix[10,1] = 4
matrix survey_matrix[10,2] = r(mean)
matrix survey_matrix[10,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[10,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q16_norm if wave==2 & online==1, detail
matrix survey_matrix[11,1] = 4.25
matrix survey_matrix[11,2] = r(mean)
matrix survey_matrix[11,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[11,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q16_norm if wave==1 & online==0, detail
matrix survey_matrix[12,1] = 4.5
matrix survey_matrix[12,2] = r(mean)
matrix survey_matrix[12,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[12,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q17_norm if wave==1 & online==1, detail
matrix survey_matrix[13,1] = 5
matrix survey_matrix[13,2] = r(mean)
matrix survey_matrix[13,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[13,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q17_norm if wave==2 & online==1, detail
matrix survey_matrix[14,1] = 5.25
matrix survey_matrix[14,2] = r(mean)
matrix survey_matrix[14,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[14,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q17_norm if wave==1 & online==0, detail
matrix survey_matrix[15,1] = 5.5
matrix survey_matrix[15,2] = r(mean)
matrix survey_matrix[15,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[15,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q18_norm if wave==1 & online==1, detail
matrix survey_matrix[16,1] = 6
matrix survey_matrix[16,2] = r(mean)
matrix survey_matrix[16,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[16,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q18_norm if wave==2 & online==1, detail
matrix survey_matrix[17,1] = 6.25
matrix survey_matrix[17,2] = r(mean)
matrix survey_matrix[17,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[17,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q18_norm if wave==1 & online==0, detail
matrix survey_matrix[18,1] = 6.5
matrix survey_matrix[18,2] = r(mean)
matrix survey_matrix[18,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[18,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q19_norm if wave==1 & online==1, detail
matrix survey_matrix[19,1] = 7
matrix survey_matrix[19,2] = r(mean)
matrix survey_matrix[19,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[19,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q19_norm if wave==2 & online==1, detail
matrix survey_matrix[20,1] = 7.25
matrix survey_matrix[20,2] = r(mean)
matrix survey_matrix[20,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[20,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q19_norm if wave==1 & online==0, detail
matrix survey_matrix[21,1] = 7.5
matrix survey_matrix[21,2] = r(mean)
matrix survey_matrix[21,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[21,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q20_norm if wave==1 & online==1, detail
matrix survey_matrix[22,1] = 8
matrix survey_matrix[22,2] = r(mean)
matrix survey_matrix[22,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[22,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q20_norm if wave==2 & online==1, detail
matrix survey_matrix[23,1] = 8.25
matrix survey_matrix[23,2] = r(mean)
matrix survey_matrix[23,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[23,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q20_norm if wave==1 & online==0, detail
matrix survey_matrix[24,1] = 8.5
matrix survey_matrix[24,2] = r(mean)
matrix survey_matrix[24,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[24,4] = r(mean)+1.96*r(sd)/sqrt(r(N))


svmat survey_matrix, names(sm_)

tw (pccapsym sm_3 sm_1 sm_4 sm_1, msymbol(point) lwidth(medium)) (scatter sm_2 sm_1 if sm_1==1 | sm_1==2 | sm_1==3 | sm_1==4 | sm_1==5 | sm_1==6 | sm_1==7 | sm_1==8, msymbol(oh)) (scatter sm_2 sm_1 if sm_1==1.25 | sm_1==2.25 | sm_1==3.25 | sm_1==4.25 | sm_1==5.25 | sm_1==6.25 | sm_1==7.25 | sm_1==8.25, msymbol(t))  (scatter sm_2 sm_1 if sm_1==1.5 | sm_1==2.5 | sm_1==3.5 | sm_1==4.5 | sm_1==5.5 | sm_1==6.5 | sm_1==7.5 | sm_1==8.5, msymbol(d)), ///
xtitle("")  ytitle("Mean public support") xlabel(1.25 "UKR shouldn't negotiate" 2.25 "Morally wrong to sell out" 3.25 "RUS cannot be trusted" 4.25 "RUS will exploit peace" 5.25 "Peace is morally right" 6.25 "UKR must make peace" 7.25 "UKR must make terr. concessions" 8.25 "Strategic to keep negotiating", angle(60)) legend(order( 2 "Online wave 1" 3 "Online wave 2" 4 "Telephone wave 1") position(2) bmargin(medium))

quietly graph export figure_a4a.jpg, replace

*A-4b: Terms of Peace

drop sm_*

matrix survey_matrix = J(29,4,.)	
		
summarize q21_norm if wave==1 & online==1, detail
matrix survey_matrix[1,1] = 1
matrix survey_matrix[1,2] = r(mean)
matrix survey_matrix[1,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[1,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q21_norm if wave==2 & online==1, detail
matrix survey_matrix[2,1] = 1.25
matrix survey_matrix[2,2] = r(mean)
matrix survey_matrix[2,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[2,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q21_norm if wave==1 & online==0, detail
matrix survey_matrix[3,1] = 1.5
matrix survey_matrix[3,2] = r(mean)
matrix survey_matrix[3,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[3,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q22_norm if wave==1 & online==1, detail
matrix survey_matrix[4,1] = 2
matrix survey_matrix[4,2] = r(mean)
matrix survey_matrix[4,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[4,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q22_norm if wave==2 & online==1, detail
matrix survey_matrix[5,1] = 2.25
matrix survey_matrix[5,2] = r(mean)
matrix survey_matrix[5,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[5,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q22_norm if wave==1 & online==0, detail
matrix survey_matrix[6,1] = 2.5
matrix survey_matrix[6,2] = r(mean)
matrix survey_matrix[6,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[6,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q23_norm if wave==1 & online==1, detail
matrix survey_matrix[7,1] = 3
matrix survey_matrix[7,2] = r(mean)
matrix survey_matrix[7,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[7,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q23_norm if wave==2 & online==1, detail
matrix survey_matrix[8,1] = 3.25
matrix survey_matrix[8,2] = r(mean)
matrix survey_matrix[8,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[8,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q23_norm if wave==1 & online==0, detail
matrix survey_matrix[9,1] = 3.5
matrix survey_matrix[9,2] = r(mean)
matrix survey_matrix[9,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[9,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q24_norm if wave==1 & online==1, detail
matrix survey_matrix[10,1] = 4
matrix survey_matrix[10,2] = r(mean)
matrix survey_matrix[10,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[10,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q24_norm if wave==2 & online==1, detail
matrix survey_matrix[11,1] = 4.25
matrix survey_matrix[11,2] = r(mean)
matrix survey_matrix[11,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[11,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q24_norm if wave==1 & online==0, detail
matrix survey_matrix[12,1] = 4.5
matrix survey_matrix[12,2] = r(mean)
matrix survey_matrix[12,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[12,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q25_norm if wave==1 & online==1, detail
matrix survey_matrix[13,1] = 5
matrix survey_matrix[13,2] = r(mean)
matrix survey_matrix[13,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[13,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q25_norm if wave==2 & online==1, detail
matrix survey_matrix[14,1] = 5.25
matrix survey_matrix[14,2] = r(mean)
matrix survey_matrix[14,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[14,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q25_norm if wave==1 & online==0, detail
matrix survey_matrix[15,1] = 5.5
matrix survey_matrix[15,2] = r(mean)
matrix survey_matrix[15,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[15,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q26_norm if wave==1 & online==1, detail
matrix survey_matrix[16,1] = 6
matrix survey_matrix[16,2] = r(mean)
matrix survey_matrix[16,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[16,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q26_norm if wave==2 & online==1, detail
matrix survey_matrix[17,1] = 6.25
matrix survey_matrix[17,2] = r(mean)
matrix survey_matrix[17,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[17,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q26_norm if wave==1 & online==0, detail
matrix survey_matrix[18,1] = 6.5
matrix survey_matrix[18,2] = r(mean)
matrix survey_matrix[18,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[18,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q27_norm if wave==1 & online==1, detail
matrix survey_matrix[19,1] = 7
matrix survey_matrix[19,2] = r(mean)
matrix survey_matrix[19,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[19,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q27_norm if wave==2 & online==1, detail
matrix survey_matrix[20,1] = 7.25
matrix survey_matrix[20,2] = r(mean)
matrix survey_matrix[20,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[20,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q27_norm if wave==1 & online==0, detail
matrix survey_matrix[21,1] = 7.5
matrix survey_matrix[21,2] = r(mean)
matrix survey_matrix[21,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[21,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q28_norm if wave==1 & online==1, detail
matrix survey_matrix[22,1] = 8
matrix survey_matrix[22,2] = r(mean)
matrix survey_matrix[22,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[22,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q28_norm if wave==2 & online==1, detail
matrix survey_matrix[23,1] = 8.25
matrix survey_matrix[23,2] = r(mean)
matrix survey_matrix[23,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[23,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q28_norm if wave==1 & online==0, detail
matrix survey_matrix[24,1] = 8.5
matrix survey_matrix[24,2] = r(mean)
matrix survey_matrix[24,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[24,4] = r(mean)+1.96*r(sd)/sqrt(r(N))


summarize q29_norm if wave==1 & online==1, detail
matrix survey_matrix[25,1] = 9
matrix survey_matrix[25,2] = r(mean)
matrix survey_matrix[25,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[25,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q29_norm if wave==2 & online==1, detail
matrix survey_matrix[26,1] = 9.25
matrix survey_matrix[26,2] = r(mean)
matrix survey_matrix[26,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[26,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize q29_norm if wave==1 & online==0, detail
matrix survey_matrix[27,1] = 9.5
matrix survey_matrix[27,2] = r(mean)
matrix survey_matrix[27,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[27,4] = r(mean)+1.96*r(sd)/sqrt(r(N))


svmat survey_matrix, names(sm_)

tw (pccapsym sm_3 sm_1 sm_4 sm_1, msymbol(point) lwidth(medium)) (scatter sm_2 sm_1 if sm_1==1 | sm_1==2 | sm_1==3 | sm_1==4 | sm_1==5 | sm_1==6 | sm_1==7 | sm_1==8 | sm_1==9, msymbol(oh)) (scatter sm_2 sm_1 if sm_1==1.25 | sm_1==2.25 | sm_1==3.25 | sm_1==4.25 | sm_1==5.25 | sm_1==6.25 | sm_1==7.25 | sm_1==8.25, msymbol(t))  (scatter sm_2 sm_1 if sm_1==1.5 | sm_1==2.5 | sm_1==3.5 | sm_1==4.5 | sm_1==5.5 | sm_1==6.5 | sm_1==7.5 | sm_1==8.5 | sm_1==9.5, msymbol(d)), ///
xtitle("")  ytitle("Mean public support") xlabel(1.25 "UKR shouldn't join NATO" 2.25 "Western security guarantees" 3.25 "Russian as official language" 4.25 "Crimea as part of Russia" 5.25 "Independent DNR/LNR" 6.25 "Reduce UKR army size" 7.25 "Voting by DNR/LNR" 8.25 "UKR reject joining EU" 9.25 "Zelensky stepping down", angle(60)) legend(order( 2 "Online wave 1" 3 "Online wave 2" 4 "Telephone wave 1") position(2) bmargin(medium))

quietly graph export figure_a4b.jpg, replace

***FIGURE A-8: What explained Ukraine's military success

drop sm_* 

matrix survey_matrix = J(10,4,.)	
		
summarize milsuccess_q9_norm if wave==1 & online==1, detail
matrix survey_matrix[1,1] = 1
matrix survey_matrix[1,2] = r(mean)
matrix survey_matrix[1,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[1,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize milsuccess_q9_norm if wave==1 & telephone==1, detail
matrix survey_matrix[2,1] = 1.25
matrix survey_matrix[2,2] = r(mean)
matrix survey_matrix[2,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[2,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize milsuccess_q10_norm if wave==1 & online==1, detail
matrix survey_matrix[3,1] = 1.75
matrix survey_matrix[3,2] = r(mean)
matrix survey_matrix[3,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[3,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize milsuccess_q10_norm if wave==1 & telephone==1, detail
matrix survey_matrix[4,1] = 2
matrix survey_matrix[4,2] = r(mean)
matrix survey_matrix[4,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[4,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize milsuccess_q11_norm if wave==1 & online==1, detail
matrix survey_matrix[5,1] = 2.5
matrix survey_matrix[5,2] = r(mean)
matrix survey_matrix[5,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[5,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize milsuccess_q11_norm if wave==1 & telephone==1, detail
matrix survey_matrix[6,1] = 2.75
matrix survey_matrix[6,2] = r(mean)
matrix survey_matrix[6,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[6,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize milsuccess_q12_norm if wave==1 & online==1, detail
matrix survey_matrix[7,1] = 3.25
matrix survey_matrix[7,2] = r(mean)
matrix survey_matrix[7,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[7,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize milsuccess_q12_norm if wave==1 & telephone==1, detail
matrix survey_matrix[8,1] = 3.5
matrix survey_matrix[8,2] = r(mean)
matrix survey_matrix[8,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[8,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize milsuccess_q13_norm if wave==1 & online==1, detail
matrix survey_matrix[9,1] = 4
matrix survey_matrix[9,2] = r(mean)
matrix survey_matrix[9,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[9,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

summarize milsuccess_q13_norm if wave==1 & telephone==1, detail
matrix survey_matrix[10,1] = 4.25
matrix survey_matrix[10,2] = r(mean)
matrix survey_matrix[10,3] = r(mean)-1.96*r(sd)/sqrt(r(N))
matrix survey_matrix[10,4] = r(mean)+1.96*r(sd)/sqrt(r(N))

svmat survey_matrix, names(sm_)

tw (pccapsym sm_3 sm_1 sm_4 sm_1, msymbol(point) lwidth(medium)) (scatter sm_2 sm_1 if sm_1==1 | sm_1==1.75 | sm_1==2.5 | sm_1==3.25 | sm_1==4, msymbol(oh)) (scatter sm_2 sm_1 if sm_1==1.25 | sm_1==2 | sm_1==2.75 | sm_1==3.5 | sm_1==4.25, msymbol(t)), ///
xtitle("")  ytitle("Ukraine's army success due to") xlabel(1.12 "Ukrainian soldiers" 1.87 "Drones" 2.62 "Western weapons" 3.37 "Ukrainian people" 4.12 "Russian army low quality", angle(60)) legend(order( 2 "Online wave 1" 3 "Telephone wave 1") position(2) bmargin(medium))

quietly graph export figure_a8.jpg, replace

***FIGURE A-9: Baseline support for agreement decreases in 2023 relative to 2022

preserve

drop wave2
gen wave2=1
replace wave2=2 if wave==2 & online==1
replace wave2=3 if wave==1 & online==0
replace wave2=4 if wave==2 & online==0	
	


**ADJUSTING VARIABLES IN OMNIBUS (some variables with the same name have different meaning in omnibus compared to the other waves...)
replace q2=q2_gender if telephone==1 & wave==2
replace q1=q1_age  if telephone==1 & wave==2
replace q4=q4_language if telephone==1 & wave==2
replace q3=q3_educ if telephone==1 & wave==2

		
eststo m1: reg baseline_support ib3.wave2, vce(robust)
eststo m2: reghdfe baseline_support ib3.wave2 q1, a(oblast_feb24 i.q2 i.q3 i.q4 ) vce(cluster oblast_feb24)
	

coefplot (m1, label(No controls)) (m2, label(With controls)), vertical keep(1.wave2 4.wave2) xlabel(1 `" "Online wave 1" "June 2022" "' 2 `" "Telephone wave 2" "May 2023" "' ,angle(45))  levels(95 90) title("Support for settlement with Russia (relative to telephone wave 1 in June 2022)", size(medium))

quietly graph export figure_a9.jpg, replace

eststo clear 
restore

***FIGURE A-10: Self reported exposure and recorded combat activity in region
***REQUIRES A SEPARATE DATASET SEE THE LINE 1002



***FIGURE A-11: First-difference estimates of relationship between violence exposure and attitudes, online panel – by oblast

*A-11a: Negotiating pronciples
forvalues i = 2(1)26 {
eststo m1`i': reghdfe fd_pca_principlesneg0_1 fd_pca_violexposure0_1 if oblast_lag==`i', vce( robust) 		
coefplot m*, drop(_cons) vertical yline(0, lcolor(red)) levels(95 90) legend(off) ///
coeflabels(m12= "City of Kyiv" m13= "Kyiv oblast"  m14= "Vinnytsia" m15= "Volyn" m16= "Dnipropetrovsk" m17= "Donetsk" m18= "Zhytomyr" m19= "Zakarpattya" m110= "Zaporizhzhya" m111= "Ivano-Frankivsk" m112= "Kirovohrad" m113= "Luhansk" m114= "Lviv" m115= "Mykolayiv" m116= "Odesa" m117= "Poltava" m118= "Rivne" m119= "Sumy" m120= "Ternopil" m121 = "Kharkiv" m122= "Kherson" m123= "Khmelnytskiy" m124= "Cherkasy" m125= "Chernivtsi" m126= "Chernihiv",   labsize(small) angle(45)) aseq swapnames
	}	

quietly graph export figure_a11a.jpg, replace
eststo clear 

*A-11b: Peace terms
forvalues i = 2(1)26 {
eststo m1`i': reghdfe fd_pca_peacecomp0_1 fd_pca_violexposure0_1 if oblast_lag==`i', vce( robust) 		
coefplot m*, drop(_cons) vertical yline(0, lcolor(red)) levels(95 90) legend(off) ///
coeflabels(m12= "City of Kyiv" m13= "Kyiv oblast"  m14= "Vinnytsia" m15= "Volyn" m16= "Dnipropetrovsk" m17= "Donetsk" m18= "Zhytomyr" m19= "Zakarpattya" m110= "Zaporizhzhya" m111= "Ivano-Frankivsk" m112= "Kirovohrad" m113= "Luhansk" m114= "Lviv" m115= "Mykolayiv" m116= "Odesa" m117= "Poltava" m118= "Rivne" m119= "Sumy" m120= "Ternopil" m121 = "Kharkiv" m122= "Kherson" m123= "Khmelnytskiy" m124= "Cherkasy" m125= "Chernivtsi" m126= "Chernihiv",   labsize(small) angle(45)) aseq swapnames
	}
quietly graph export figure_a11b.jpg, replace
eststo clear 


***FIGURE A-12: First-difference estimates of relationship between violence exposure and attitudes, online panel – jackknife

*A-12a: Negotiating principlea
foreach v in fd_pca_principlesneg0_1 {
	eststo m`v': reghdfe `v' fd_pca_violexposure0_1, vce(cluster oblast_lag)
}

foreach v in fd_pca_principlesneg0_1 {
	eststo jk`v': jackknife: reg `v' fd_pca_violexposure0_1, cluster(oblast_lag)
}
	
coefplot (m*) (jk*), drop(_cons) vertical yline(0, lcolor(white)) levels(95 90) coeflabels(mfd_pca_principlesneg0_1="PCA principles of neg., FD - no jackknife" jkfd_pca_principlesneg0_1="PCA principles of neg., FD - with jackknife" ,  labsize(small) angle(45)) legend(off) aseq swapnames

quietly graph export figure_a12a.jpg, replace

eststo clear 



*A-12b: Peace terms
foreach v in fd_pca_peacecomp0_1 {
	eststo m`v': reghdfe `v' fd_pca_violexposure0_1, vce(cluster oblast_lag)
}

foreach v in fd_pca_peacecomp0_1 {
	eststo jk`v': jackknife: reg `v' fd_pca_violexposure0_1, cluster(oblast_lag)
}
	
coefplot (m*) (jk*), drop(_cons) vertical yline(0, lcolor(white)) levels(95 90) coeflabels(mfd_pca_peacecomp0_1="PCA peace components - no jackknife" jkfd_pca_peacecomp0_1="PCA peace components - with jackknife" ,  labsize(small) angle(45)) legend(off) aseq swapnames

quietly graph export figure_a12b.jpg, replace
eststo clear 


**********************************************************************************
***FIGURE A-10: Self reported exposure and recorded combat activity in region

// load in intersected, raw data
// NOTE: qgis export excludes text features

import delimited "events_latest_14sept2022_inter.csv", clear 

	
	gen vina_event=1
	tostring date, gen(date_s)
	
	gen smart_date=date(date_s, "YMD")

	rename adm1_pcode ADM1_PCODE
	
gen oblast_feb24 =.

// NOT PRESENT: 														Avtonomna Respublika Krym	UA01
// NOT PRESENT: 														Sevastopilska	UA85	

//       4. Vinnytsia oblast |        138        4.58       22.94, 		Vinnytska	UA05
	replace oblast_feb24=4 if ADM1_PCODE=="UA05"
	
//           5. Volyn oblast |         68        2.25       25.20, 		Volynska	UA07
	replace oblast_feb24=5 if ADM1_PCODE=="UA07"
	
//  6. Dnipropetrovsk oblast |        324       10.74       35.94, 		Dnipropetrovska	UA12
	replace oblast_feb24=6  if ADM1_PCODE=="UA12" 
	
//         7. Donetsk oblast |        115        3.81       39.75, 		Donetska	UA14
	replace oblast_feb24=7 if ADM1_PCODE=="UA14"  

//        8. Zhytomyr oblast |         83        2.75       42.51, 		Zhytomyrska	UA18
	replace oblast_feb24=8 if ADM1_PCODE=="UA18"  
	
//     9. Zakarpattia oblast |         36        1.19       43.70, 		Zakarpatska	UA21
	replace oblast_feb24=9 if ADM1_PCODE=="UA21" 
	
//   10. Zaporizhzhia oblast |        123        4.08       47.78, 		Zaporizka	UA23
	replace oblast_feb24=10 if ADM1_PCODE=="UA23"  
	
//11. Ivano-Frankivsk oblast |         63        2.09       49.87, 		Ivano-Frankivska	UA26
	replace oblast_feb24=11 if ADM1_PCODE=="UA26"  
	
//            3. Kyiv oblast |        191        6.33       18.37, 		Kyivska	UA32
	replace oblast_feb24=3 if ADM1_PCODE=="UA32" 
	
//     12. Kirovohrad oblast |         65        2.16       52.02, 		Kirovohradska	UA35
	replace oblast_feb24=12 if ADM1_PCODE=="UA35" 
	
//       13. Luhans'k oblast |         28        0.93       52.95, 		Luhanska	UA44
	replace oblast_feb24=13 if ADM1_PCODE=="UA44" 
	
//           14. Lviv oblast |        159        5.27       58.22, 		Lvivska	UA46
	replace oblast_feb24=14 if ADM1_PCODE=="UA46"  
	
//       15. Mykolaiv oblast |        106        3.51       61.74, 		Mykolaivska	UA48
	replace oblast_feb24=15 if ADM1_PCODE=="UA48"  
	
//          16. Odesa oblast |        211        7.00       68.73, 		Odeska	UA51
	replace oblast_feb24=16 if ADM1_PCODE=="UA51" 
	
//        17. Poltava oblast |        103        3.42       72.15, 		Poltavska	UA53
	replace oblast_feb24=17 if ADM1_PCODE=="UA53"  
	
//          18. Rivne oblast |         76        2.52       74.67, 		Rivnenska	UA56
	replace oblast_feb24=18 if ADM1_PCODE=="UA56"  
	
//           19. Sumy oblast |        100        3.32       77.98, 		Sumska	UA59
	replace oblast_feb24=19 if ADM1_PCODE=="UA59" 
	
//       20. Ternopil oblast |         48        1.59       79.58, 		Ternopilska	UA61
	replace oblast_feb24=20 if ADM1_PCODE=="UA61"  
	
//        21. Kharkiv oblast |        249        8.26       87.83, 		Kharkivska	UA63
	replace oblast_feb24=21 if ADM1_PCODE=="UA63"  
	
//        22. Kherson oblast |         22        0.73       88.56, 		Khersonska	UA65
	replace oblast_feb24=22 if ADM1_PCODE=="UA65"  
	
//   23. Khmelnytskyi oblast |         83        2.75       91.31, 		Khmelnytska	UA68
	replace oblast_feb24=23 if ADM1_PCODE=="UA68"  
	
//       24. Cherkasy oblast |        100        3.32       94.63, 		Cherkaska	UA71
	replace oblast_feb24=24 if ADM1_PCODE=="UA71" 
	
//     25. Chernivtsi oblast |         54        1.79       96.42, 		Chernivetska	UA73
	replace oblast_feb24=25 if ADM1_PCODE=="UA73" 
	
//      26. Chernihiv oblast |        108        3.58      100.00, 		Chernihivska	UA74
	replace oblast_feb24=26 if ADM1_PCODE=="UA74"  
	
//           2. City of Kyiv |        363       12.04       12.04, 		Kyivska	CITY UA80
	replace oblast_feb24=2 if ADM1_PCODE=="UA80"  	
	
collapse (sum) vina_event t_aad_b t_airstrike_b t_armor_b t_arrest_b t_artillery_b t_control_b t_killing_b t_firefight_b t_ied_b t_property_b t_raid_b t_occupy_b t_cyber_b t_hospital_b t_milcas_b t_civcas_b, by(oblast_feb24 smart_date)

tsset oblast_feb24 smart_date

	tsfill, full 

	replace vina_event=0 if vina_event==. 

	
tsset oblast_feb24 smart_date

	gen prior_week_events= vina_event + L.vina_event + L2.vina_event + L3.vina_event + L4.vina_event + L5.vina_event + L6.vina_event

foreach v in t_aad_b t_airstrike_b t_armor_b t_arrest_b t_artillery_b t_control_b t_killing_b t_firefight_b t_ied_b t_property_b t_raid_b t_occupy_b t_cyber_b t_hospital_b t_milcas_b t_civcas_b{
	
	replace `v'=0 if `v'==. 
	gen prior_week_`v'=`v'+L.`v' + L2.`v' + L3.`v' + L4.`v' + L5.`v' + L6.`v'
}
		
	rename smart_date smart_start_date 
	
	sort oblast_feb24 smart_start_date
	
save "vina_oblastXday.dta", replace
	
clear all





use "RedLines_dataset.dta", clear

keep if wave==1&telephone==1

tostring start_day start_month start_year, force replace

	gen start_date= start_day + "/" + start_month + "/" + start_year

	gen smart_start_date=date(start_date, "DMY")
	
	sort oblast_feb24 smart_start_date 
	
    merge oblast_feb24 smart_start_date using "vina_oblastXday.dta"

	keep if _merge==3
	
	
	foreach v in prior_week_events prior_week_t_aad_b prior_week_t_airstrike_b prior_week_t_armor_b prior_week_t_arrest_b prior_week_t_artillery_b prior_week_t_control_b prior_week_t_killing_b prior_week_t_firefight_b prior_week_t_ied_b prior_week_t_property_b prior_week_t_raid_b prior_week_t_occupy_b prior_week_t_cyber_b prior_week_t_hospital_b prior_week_t_milcas_b prior_week_t_civcas_b{
		
	summarize `v'
		scalar `v'_mean = r(mean)	
		scalar `v'_sd = r(sd)	
		
		gen `v'_std= (`v'-`v'_mean)/(`v'_sd)
	}

	


pca prior_week_events_std prior_week_t_aad_b_std prior_week_t_airstrike_b_std prior_week_t_armor_b_std prior_week_t_arrest_b_std prior_week_t_artillery_b_std prior_week_t_control_b_std prior_week_t_killing_b_std prior_week_t_firefight_b_std prior_week_t_ied_b_std prior_week_t_property_b_std prior_week_t_raid_b_std prior_week_t_occupy_b_std prior_week_t_cyber_b_std prior_week_t_hospital_b_std prior_week_t_milcas_b_std prior_week_t_civcas_b_std, comp(1) 
		predict pc1
		rename pc1 pca_priorweek_attacks


***FIGURE A-10a: Telephone sample

tw (lpolyci pca_priorweek_attacks pca_violexposure), legend(off) xtitle("Self reported exposure (PCA), telephone sample") ytitle("Conflict events (PCA), telephone sample")

quietly graph export figure_a10a.jpg, replace
	
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
* ONLINE SURVEYS									    *
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

use "RedLines_dataset.dta", clear

keep if wave==1&online==1 | wave==2 & online==1
	
tostring start_day start_month start_year, force replace

	gen start_date= start_day + "/" + start_month + "/" + start_year

	gen smart_start_date=date(start_date, "DMY")
	
	sort oblast_feb24 smart_start_date 
	
    merge oblast_feb24 smart_start_date using "vina_oblastXday.dta"

	keep if _merge==3
	

	foreach v in prior_week_events prior_week_t_aad_b prior_week_t_airstrike_b prior_week_t_armor_b prior_week_t_arrest_b prior_week_t_artillery_b prior_week_t_control_b prior_week_t_killing_b prior_week_t_firefight_b prior_week_t_ied_b prior_week_t_property_b prior_week_t_raid_b prior_week_t_occupy_b prior_week_t_cyber_b prior_week_t_hospital_b prior_week_t_milcas_b prior_week_t_civcas_b{
		
	summarize `v'
		scalar `v'_mean = r(mean)	
		scalar `v'_sd = r(sd)	
		
		gen `v'_std= (`v'-`v'_mean)/(`v'_sd)
	}
		
pca prior_week_events_std prior_week_t_aad_b_std prior_week_t_airstrike_b_std prior_week_t_armor_b_std prior_week_t_arrest_b_std prior_week_t_artillery_b_std prior_week_t_control_b_std prior_week_t_killing_b_std prior_week_t_firefight_b_std prior_week_t_ied_b_std prior_week_t_property_b_std prior_week_t_raid_b_std prior_week_t_occupy_b_std prior_week_t_cyber_b_std prior_week_t_hospital_b_std prior_week_t_milcas_b_std prior_week_t_civcas_b_std, comp(1) 
		predict pc1
		rename pc1 pca_priorweek_attacks

***FIGURE A-10b: Online sample
tw (lpolyci pca_priorweek_attacks pca_violexposure), legend(off) xtitle("Self reported exposure (PCA), online panel") ytitle("Conflict events (PCA), online panel")

quietly graph export figure_a10b.jpg, replace

************************************** FIGURES A1-A3, A5-A7 *******************************************
**** FIGURE A1

use "RedLines_dataset.dta", clear


hist age if telephone==1 & wave==1, discrete percent xlabel(20(5)90) title("Age") subtitle("(CATI Panel)") xtitle("") color(maroon) note("Number of Respondents: 3016") ///
plotregion(margin(0 1 1 1)) 

quietly graph export figure_a1_age.jpg, replace

hist gender if telephone==1 & wave==1, discrete percent gap(40) title("Gender") subtitle("(CATI Panel)") xtitle("") xlabel(0 "Male" 1 "Female") color(maroon) note("Number of Respondents: 3016") plotregion(margin(0 20 1 1)) 

quietly graph export figure_a1_gender.jpg, replace

hist education2 if telephone==1 & wave==1, discrete percent gap(20) start(1) title("Education") subtitle("(CATI Panel)") color(maroon) ///
xlabel(1 "Primary" 2 "Secondary" 3 "Higher Education") xtitle("") ///
note("Number of Respondents: 3016") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a1_education.jpg, replace

hist language2 if telephone==1 & wave==1, discrete percent gap(70) start(1) title("Language") subtitle("(CATI Panel)") color(maroon) ///
xlabel(1 `""Only" "Ukrainian""' 2 `""Mostly" "Ukrainian""' 3 `""Ukrainian/" "Russian""' 4 `""Mostly" "Russian""' 5 `""Only" "Russian""' 6 "Other" 7 "Refuse") xtitle("") ///
note("Number of Respondents: 3016") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a1_language.jpg, replace

hist religion if telephone==1 & wave==1, discrete percent gap(70) title("Religion") subtitle("(CATI Panel)") color(maroon)  xlabel(1/12, valuelabel angle(45)) xtitle("") note("Number of Respondents: 3016") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a1_religion.jpg, replace

hist stillcommunicate if telephone==1 & wave==1, discrete percent gap(70) title("Still Communicate with Relatives/Friends in Russia") subtitle("(CATI Panel)") color(maroon)  xlabel(0/1, valuelabel) xtitle("") note("Number of Respondents: 3016") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a1_communicate.jpg, replace

hist settlement_type_feb24 if telephone==1 & wave==1, discrete percent gap(20)  title("Settlement Type") subtitle("(CATI Panel)") color(maroon)  xlabel(1/7, valuelabel angle(45)) xtitle("") note("Number of Respondents: 3016") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a1_settlement.jpg, replace

hist oblast_feb24 if telephone==1 & wave==1, discrete percent gap(20) start(2) title("Oblast") subtitle("(CATI Panel)") color(maroon)  xlabel(2/26, valuelabel angle(45)) xtitle("") note("Number of Respondents: 3016") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a1_oblast.jpg, replace

**** FIGURE A2

hist age if telephone==1 & wave==2, discrete percent xlabel(20(20)100) title("Age") subtitle("(Phone Sample 2)") xtitle("") color(maroon) note("Number of Respondents: 2013") plotregion(margin(0 1 1 1)) 

quietly graph export figure_a2_age.jpg, replace

hist gender if telephone==1 & wave==2, discrete percent gap(40) title("Gender") subtitle("(Phone Sample 2)") xtitle("") xlabel(0 "Male" 1 "Female") color(maroon) note("Number of Respondents: 2013") ///
plotregion(margin(0 20 1 1)) 

quietly graph export figure_a2_gender.jpg, replace

hist education2 if telephone==1 & wave==2, discrete percent gap(20) start(1) title("Education") subtitle("(Phone Sample 2)") color(maroon) ///
xlabel(1 "Primary" 2 "Secondary" 3 "Higher Education") xtitle("") ///
note("Number of Respondents: 2013") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a2_education.jpg, replace

hist language3, discrete percent gap(70) start(1) title("Language") subtitle("(Phone Sample 2)") color(maroon) ///
xlabel(1 "Ukrainian" 2 "Russian" 3 `""Both Ukrainian" "and Russian""' 4 "Other" 5 "DK/Refuse") xtitle("") ///
note("Number of Respondents: 2013") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a2_language.jpg, replace

hist settlement_type_feb24 if telephone==1 & wave==2, discrete percent gap(20)  title("Settlement Type") subtitle("(Phone Sample 2)") color(maroon)  xlabel(1/7, valuelabel angle(45)) xtitle("") note("Number of Respondents: 2013") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a2_settlement.jpg, replace

hist oblast_feb24 if telephone==1 & wave==2, discrete percent gap(20) start(2) title("Oblast") subtitle("(Phone Sample 2)") color(maroon)  xlabel(2/26, valuelabel angle(45)) xtitle("") note("Number of Respondents: 2013") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a2_oblast.jpg, replace


******* FIGURE A3

hist age if online==1, discrete percent xlabel(20(5)55) title("Age") subtitle("(Online Panel)") xtitle("") color(maroon) note("Number of Respondents: 1729") plotregion(margin(0 1 1 1)) 

quietly graph export figure_a3_age.jpg, replace

hist gender if online==1, discrete percent gap(40) title("Gender") subtitle("(Online Panel)") xtitle("") xlabel(0 "Male" 1 "Female") color(maroon) note("Number of Respondents: 1729") ///
plotregion(margin(0 20 1 1)) 

quietly graph export figure_a3_gender.jpg, replace

hist education2 if online==1, discrete percent gap(20) start(1) title("Education") subtitle("(Online Panel)") color(maroon) ///
xlabel(1 "Primary" 2 "Secondary" 3 "Higher Education") xtitle("") ///
note("Number of Respondents: 1729") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a3_education.jpg, replace

hist language2 if online==1, discrete percent gap(70) start(1) title("Language") subtitle("(Online Panel)") color(maroon) ///
xlabel(1 `""Only" "Ukrainian""' 2 `""Mostly" "Ukrainian""' 3 `""Ukrainian/" "Russian""' 4 `""Mostly" "Russian""' 5 `""Only" "Russian""' 6 "Other" 7 "Refuse") xtitle("") ///
note("Number of Respondents: 1729") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a3_language.jpg, replace

hist religion if online==1, discrete percent gap(70) title("Religion") subtitle("(Online Panel)") color(maroon)  xlabel(1/12, valuelabel angle(45)) xtitle("") note("Number of Respondents: 1729") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a3_religion.jpg, replace

hist stillcommunicate if online==1, discrete percent gap(70) title("Still Communicate with Relatives/Friends in Russia") subtitle("(Online Panel)") color(maroon)  xlabel(0/1, valuelabel) xtitle("") note("Number of Respondents: 1729") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a3_communicate.jpg, replace

hist type_online_feb24 if online==1, discrete percent gap(20)  title("Settlement Type") subtitle("(Online Panel)") color(maroon)  xlabel(1/2, valuelabel) xtitle("") note("Number of Respondents: 1729") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a3_settlement.jpg, replace

hist oblast_feb24 if online==1, discrete percent gap(20) start(2) title("Oblast") subtitle("(Online Panel)") color(maroon)  xlabel(2/26, valuelabel angle(45)) xtitle("") note("Number of Respondents: 1729") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a3_oblast.jpg, replace


******* FIGURE A5

hist exposure_q14a if telephone==1 & wave==1, discrete percent gap(20) title("Displacement") subtitle("(CATI Panel)") color(maroon)  xlabel(1/3, valuelabel) xtitle("") note("Number of Respondents: 3016") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a5_displacement.jpg, replace

hist exposure_q14b if telephone==1 & wave==1, discrete percent gap(50) title("Did you leave ...?") subtitle("(CATI Panel)") color(maroon)  xlabel(1 `""as a result of" "the violence""' 2 `""in anticipation" "of violence""' 3 "Refuse") xtitle("") note("Number of Respondents: 1096") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a5_didyouleave.jpg, replace

hist exposure_q15a1 if telephone==1 & wave==1, discrete percent gap(50) title("Exposure to Shelling") subtitle(`"CATI Panel"' `"(n=3016)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") note("Number of Respondents: 3016") plotregion(margin(0 10 1 1)) name(g1, replace)

quietly graph export figure_a5_shelling.jpg, replace

hist exposure_q15a2 if telephone==1 & wave==1, discrete percent gap(50) title("Exposure to Bomb Sirens") subtitle(`"CATI Panel"' `"(n=3016)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") plotregion(margin(0 10 1 1)) name(g1, replace)

quietly graph export figure_a5_siren.jpg, replace

hist exposure_q15a3 if telephone==1 & wave==1, discrete percent gap(50) title("Exposure to Gunfire") subtitle(`"CATI Panel"' `"(n=3016)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") plotregion(margin(0 10 1 1)) name(g1, replace)

quietly graph export figure_a5_gunfire.jpg, replace

hist exposure_q15a4 if telephone==1 & wave==1, discrete percent gap(50) title("Scared to Leave Home") subtitle(`"CATI Panel"' `"(n=3016)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") plotregion(margin(0 10 1 1)) name(g1, replace)

quietly graph export figure_a5_scared.jpg, replace

hist exposure_q15a5 if telephone==1 & wave==1, discrete percent gap(50) title("Had to Go to a Shelter") subtitle(`"CATI Panel"' `"(n=3016)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") plotregion(margin(0 10 1 1)) name(g1, replace)

quietly graph export figure_a5_shelter.jpg, replace

hist exposure_q15a6 if telephone==1 & wave==1, discrete percent gap(50) title("Seen People Wounded/Injured") subtitle(`"CATI Panel"' `"(n=3016)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") plotregion(margin(0 10 1 1)) name(g1, replace)

quietly graph export figure_a5_seeninjured.jpg, replace


******* FIGURE A6 
***** These variables are named differently in the second phone survey.

replace q5=7 if telephone==1 & wave==2 & q5==8

hist q5 if telephone==1 & wave==2, discrete percent gap(50) title("Exposure to Gunfire") subtitle("(Phone Sample 2)") color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 "4-6 times" 5 "7-9 times" 6 "More than 10 times" 7 "DK/RA", alternate labsize(small)) xtitle("") plotregion(margin(0 10 1 1)) name(g1, replace)

quietly graph export figure_a6_gunfire.jpg, replace

gen q3_new=q3 if telephone==1 & wave==2
gen q4_new=q4 if telephone==1 & wave==2

replace q3_new=. if q3_new==998 | q3_new==999 // RA or DK answers
replace q4_new=. if q4_new==998 | q4_new==999 // RA or DK answers

hist q3_new, discrete percent xlabel(0(100)800) title("Injured Family and Friends") subtitle("(Phone Sample 2)") color(maroon) xtitle("")

quietly graph export figure_a6_injuredfamfriends.jpg, replace

hist q4_new, discrete percent xlabel(0(100)1000) title("Killed Family and Friends") subtitle("(Phone Sample 2)") color(maroon) xtitle("")

quietly graph export figure_a6_killedfamfriends.jpg, replace


****** FIGURE A7
****** Change the different scale of the second wave to make it consistent with the first wave  

hist exposure_q14a if online==1, discrete percent gap(20) title("Displacement") subtitle("(Online Panel)") color(maroon)  xlabel(1/3, valuelabel) xtitle("") note("Number of Respondents: 1729") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a7_displacement.jpg, replace

hist exposure_q14b if online==1, discrete percent gap(50) title("Did you leave ...?") subtitle("(Online Panel)") color(maroon)  xlabel(1 `""as a result of" "the violence""' 2 `""in anticipation" "of violence""' 3 "Refuse") xtitle("") note("Number of Respondents: 954") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a7_didyouleave.jpg, replace

hist exposure_q15a1 if online==1 & wave==1, discrete percent gap(50) title("Exposure to Shelling") subtitle(`"Online Panel-Wave 1"' `"(n=1729)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") note("Number of Respondents: 1729") plotregion(margin(0 10 1 1)) name(g1, replace)

gen exposure_q15c1_alt=exposure_q15c1
replace exposure_q15c1_alt=4 if exposure_q15c1_alt==5 | exposure_q15c1_alt==6 
replace exposure_q15c1_alt=5 if exposure_q15c1_alt==7
replace exposure_q15c1_alt=6 if exposure_q15c1_alt==8
tab exposure_q15c1_alt exposure_q15c1

hist exposure_q15c1_alt if online==1 & wave==2, discrete percent gap(50) title("Exposure to Shelling") subtitle(`"Online Panel-Wave 2"' `"(n=1729)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") note("Number of Respondents: 1729") plotregion(margin(0 10 1 1)) name(g2, replace)

graph combine g1 g2, ycommon

quietly graph export figure_a7_shelling.jpg, replace

hist exposure_q15a2 if online==1 & wave==1, discrete percent gap(50) title("Exposure to Bomb Sirens") subtitle(`"Online Panel-Wave 1"' `"(n=1729)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") plotregion(margin(0 10 1 1)) name(g1, replace)

gen exposure_q15c2_alt=exposure_q15c2
replace exposure_q15c2_alt=4 if exposure_q15c2_alt==5 | exposure_q15c2_alt==6 
replace exposure_q15c2_alt=5 if exposure_q15c2_alt==7
replace exposure_q15c2_alt=6 if exposure_q15c2_alt==8
tab exposure_q15c2_alt exposure_q15c2

hist exposure_q15c2_alt if online==1 & wave==2, discrete percent gap(50) title("Exposure to Bomb Sirens") subtitle(`"Online Panel-Wave 2"' `"(n=1729)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("")  plotregion(margin(0 10 1 1)) name(g2, replace)

graph combine g1 g2, ycommon

quietly graph export figure_a7_siren.jpg, replace

hist exposure_q15a3 if online==1 & wave==1, discrete percent gap(50) title("Exposure to Gunfire") subtitle(`"Online Panel-Wave 1"' `"(n=1729)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") plotregion(margin(0 10 1 1)) name(g1, replace)

gen exposure_q15c3_alt=exposure_q15c3
replace exposure_q15c3_alt=4 if exposure_q15c3_alt==5 | exposure_q15c3_alt==6 
replace exposure_q15c3_alt=5 if exposure_q15c3_alt==7
replace exposure_q15c3_alt=6 if exposure_q15c3_alt==8
tab exposure_q15c3_alt exposure_q15c3

hist exposure_q15c3_alt if online==1 & wave==2, discrete percent gap(50) title("Exposure to Gunfire") subtitle(`"Online Panel-Wave 2"' `"(n=1729)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("")  plotregion(margin(0 10 1 1)) name(g2, replace)

graph combine g1 g2, ycommon

quietly graph export figure_a7_gunfire.jpg, replace

hist exposure_q15a4 if online==1 & wave==1, discrete percent gap(50) title("Scared to Leave Home") subtitle(`"Online Panel-Wave 1"' `"(n=1729)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") plotregion(margin(0 10 1 1)) name(g1, replace)

gen exposure_q15c4_alt=exposure_q15c4
replace exposure_q15c4_alt=4 if exposure_q15c4_alt==5 | exposure_q15c4_alt==6 
replace exposure_q15c4_alt=5 if exposure_q15c4_alt==7
replace exposure_q15c4_alt=6 if exposure_q15c4_alt==8
tab exposure_q15c4_alt exposure_q15c4

hist exposure_q15c4_alt if online==1 & wave==2, discrete percent gap(50) title("Scared to Leave Home") subtitle(`"Online Panel-Wave 2"' `"(n=1729)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("")  plotregion(margin(0 10 1 1)) name(g2, replace)

graph combine g1 g2, ycommon

quietly graph export figure_a7_scared.jpg, replace

hist exposure_q15a5 if online==1 & wave==1, discrete percent gap(50) title("Had to Go to a Shelter") subtitle(`"Online Panel-Wave 1"' `"(n=1729)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") plotregion(margin(0 10 1 1)) name(g1, replace)

gen exposure_q15c5_alt=exposure_q15c5
replace exposure_q15c5_alt=4 if exposure_q15c5_alt==5 | exposure_q15c5_alt==6 
replace exposure_q15c5_alt=5 if exposure_q15c5_alt==7
replace exposure_q15c5_alt=6 if exposure_q15c5_alt==8
tab exposure_q15c5_alt exposure_q15c5

hist exposure_q15c5_alt if online==1 & wave==2, discrete percent gap(50) title("Had to Go to a Shelter") subtitle(`"Online Panel-Wave 2"' `"(n=1729)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("")  plotregion(margin(0 10 1 1)) name(g2, replace)

graph combine g1 g2, ycommon

quietly graph export figure_a7_shelter.jpg, replace

hist exposure_q15a6 if online==1 & wave==1, discrete percent gap(50) title("Seen People Wounded/Injured") subtitle(`"Online Panel-Wave 1"' `"(n=1729)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("") plotregion(margin(0 10 1 1)) name(g1, replace)

gen exposure_q15c6_alt=exposure_q15c6
replace exposure_q15c6_alt=4 if exposure_q15c6_alt==5 | exposure_q15c6_alt==6 
replace exposure_q15c6_alt=5 if exposure_q15c6_alt==7
replace exposure_q15c6_alt=6 if exposure_q15c6_alt==8
tab exposure_q15c6_alt exposure_q15c6

hist exposure_q15c6_alt if online==1 & wave==2, discrete percent gap(50) title("Seen People Wounded/Injured") subtitle(`"Online Panel-Wave 2"' `"(n=1729)"') color(maroon)  xlabel(1 "Never" 2 "Once" 3 "2-3 times" 4 " Near daily" 5 "Hard to say" 6 "Refuse", alternate labsize(small)) xtitle("")  plotregion(margin(0 10 1 1)) name(g2, replace)

graph combine g1 g2, ycommon

quietly graph export figure_a7_seeninjured.jpg, replace


****** FIGURE A-13

sort id wave


foreach v in shelling_exposure bombsiren_exposure gunfire_exposure shelterinplace_exposure bombshelter_exposure vizwounded_exposure{

gen `v'_wave2=`v'[_n+1] if id==id[_n+1]

tab `v'_wave2, m
tab `v' if online==1 & wave==2, m


gen diff_`v'=`v'_wave2-`v' if online==1 & wave==1
tab diff_`v', m


gen diff_`v'2=.
replace diff_`v'2=-1 if diff_`v'<0 & !missing(diff_`v') 
replace diff_`v'2=0 if diff_`v'==0 & !missing(diff_`v') 
replace diff_`v'2=1 if diff_`v'>0 & !missing(diff_`v') 
tab diff_`v'2, 
}


hist diff_shelling_exposure2, discrete percent gap(50) title("Change in Exposure to Shelling") graphregion(fcolor(ltbluishgray)) color(maroon)  xlabel(-1 "Decrease" 0 "Same" 1 "Increase", ) xtitle("") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a13_shelling.jpg, replace

hist diff_bombsiren_exposure2, discrete percent gap(50) title("Change in Exposure to Bomb Siren") graphregion(fcolor(ltbluishgray)) color(maroon)  xlabel(-1 "Decrease" 0 "Same" 1 "Increase", ) xtitle("") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a13_siren.jpg, replace

hist diff_gunfire_exposure2, discrete percent gap(50) title("Change in Exposure to Gunfire") graphregion(fcolor(ltbluishgray)) color(maroon)  xlabel(-1 "Decrease" 0 "Same" 1 "Increase", ) xtitle("") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a13_gunfire.jpg, replace

hist diff_shelterinplace_exposure2, discrete percent gap(50) title("Change in Scared to Leave Home") graphregion(fcolor(ltbluishgray)) color(maroon)  xlabel(-1 "Decrease" 0 "Same" 1 "Increase", ) xtitle("") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a13_scared.jpg, replace

hist diff_bombshelter_exposure2, discrete percent gap(50) title("Change in Had to Go to a Shelter") graphregion(fcolor(ltbluishgray)) color(maroon)  xlabel(-1 "Decrease" 0 "Same" 1 "Increase",) xtitle("") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a13_shelter.jpg, replace

hist diff_vizwounded_exposure2, discrete percent gap(50) title("Change in Seen People Wounded/Injured") graphregion(fcolor(ltbluishgray)) color(maroon)  xlabel(-1 "Decrease" 0 "Same" 1 "Increase", ) xtitle("") plotregion(margin(0 10 1 1)) 

quietly graph export figure_a13_seeninjured.jpg, replace


	
****** FIGURE A-14a


gen shelling_exposure_since=exposure_q15b1 if wave==1 & online==1
		
gen bombsiren_exposure_since=exposure_q15b2 if wave==1 & online==1
	
gen gunfire_exposure_since=exposure_q15b3 if wave==1 & online==1

gen shelterinplace_exposure_since=exposure_q15b4 if wave==1 & online==1

gen bombshelter_exposure_since=exposure_q15b5 if wave==1 & online==1

gen vizwounded_exposure_since=exposure_q15b6 if wave==1 & online==1
	
// Normalizing long-run exposure to violence 
	
	foreach v in shelling_exposure_since bombsiren_exposure_since gunfire_exposure_since shelterinplace_exposure_since bombshelter_exposure_since vizwounded_exposure_since{
		
		replace `v'=. if wave==1 & online==1 & `v'>=8
		gen `v'_n=(`v'-1)/6 if wave==1 & online==1 
	}

	tab shelling_exposure_since_n, m
	tab bombsiren_exposure_since_n, m
	tab gunfire_exposure_since_n, m
	tab shelterinplace_exposure_since_n, m
	tab bombshelter_exposure_since_n, m
	tab vizwounded_exposure_since_n, m
	
	
// violence exposure, PCA ***Telephone wave 2 ther PCA is missing value because we have data only on exposure to gunfire
	pca shelling_exposure_since_n bombsiren_exposure_since_n gunfire_exposure_since_n shelterinplace_exposure_since_n bombshelter_exposure_since_n vizwounded_exposure_since_n, comp(1) 
		predict pcsince1
		rename pcsince1 pca_sinceviolexposure
sum pca_sinceviolexposure
		
		
***STANDARTIZING TO LIE BETWEEN 0-1

foreach v of varlist pca_sinceviolexposure {
    qui summ `v'
    gen `v'0_1 = (`v' - r(min)) / (r(max) - r(min))
	sum `v'0_1
	sum `v'
}

sort id wave

replace pca_sinceviolexposure0_1=pca_sinceviolexposure0_1[_n-1] if id[_n]==id[_n-1]



**REGRESSING THE PRINCIPLES OF NEGOTIATIONS ON PCA OF VIOLENCE EXPOSURE


eststo clear 
	
foreach v in fd_pca_principlesneg0_1 fd_q13_norm fd_q14_norm fd_q15_norm fd_q16_norm fd_q17_norm fd_q18_norm fd_q19_norm fd_q20_norm{
	eststo m`v'se: reghdfe `v' fd_pca_violexposure0_1 pca_sinceviolexposure0_1, a(oblast_lag) vce(cluster oblast_lag)
	margins, dydx(fd_pca_violexposure0_1) df(24) post
	eststo m`v'sh
	est restore m`v'se
	margins, dydx(pca_sinceviolexposure0_1) df(24) post
	eststo m`v'si
	esttab, beta not 
}

coefplot (mfd_pca_principlesneg0_1sh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_pca_principlesneg0_1si, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red)))  (mfd_q13_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q13_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q14_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q14_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q15_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q15_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q16_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q16_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q17_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q17_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q18_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q18_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q19_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q19_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q20_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q20_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))), vertical yline(0, lcolor(red)) levels(95 90) xlabel(none) groups(mfd_pca_principlesneg0_1sh mfd_pca_principlesneg0_1si = "PCA principles of neg., FD" mfd_q13_normsh mfd_q13_normsi = "UKR shouldn't negotiate, FD" mfd_q14_normsh mfd_q14_normsi = "Morally wrong to sell out, FD" mfd_q15_normsh mfd_q15_normsi = "RUS cannot be trusted, FD"  mfd_q16_normsh mfd_q16_normsi = "RUS will exploit peace, FD" mfd_q17_normsh mfd_q17_normsi = "Peace is morally right, FD" mfd_q18_normsh mfd_q18_normsi = "UKR must make peace, FD" mfd_q19_normsh mfd_q19_normsi = "UKR must make terr. concessions, FD" mfd_q20_normsh mfd_q20_normsi = "Strategic to keep negotiating, FD", labsize(small) angle(45)) aseq swapnames plotlabels("violence, short term" "violence, long term") p3(nokey) p3(nokey) p4(nokey) p5(nokey) p6(nokey) p7(nokey) p8(nokey) p9(nokey) p10(nokey) p11(nokey) p12(nokey) p13(nokey) p14(nokey) p15(nokey) p16(nokey) p17(nokey) p18(nokey) graphregion (margin(15 5 1 1)) 

quietly graph export figure_a14a.jpg, replace


****** FIGURE A-14b

**REGRESSING THE COMPONENTS OF PEACE ON PCA OF VIOLENCE EXPOSURE


eststo clear 
	
foreach v in fd_pca_peacecomp0_1 fd_q21_norm fd_q22_norm fd_q23_norm fd_q24_norm fd_q25_norm fd_q26_norm fd_q27_norm fd_q28_norm fd_q29_norm{
	eststo m`v'se: reghdfe `v' fd_pca_violexposure0_1 pca_sinceviolexposure0_1, a(oblast_lag) vce(cluster oblast_lag)
	margins, dydx(fd_pca_violexposure0_1) df(24) post
	eststo m`v'sh
	est restore m`v'se
	margins, dydx(pca_sinceviolexposure0_1) df(24) post
	eststo m`v'si
	esttab, beta not 
}
	

coefplot (mfd_pca_peacecomp0_1sh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_pca_peacecomp0_1si, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red)))  (mfd_q21_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q21_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q22_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q22_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q23_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q23_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q24_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q24_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q25_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q25_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q26_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q26_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q27_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q27_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q28_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q28_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))) (mfd_q29_normsh, msymbol(d) msize(normal) mcolor(blue) ciopts(lcolor(blue blue))) (mfd_q29_normsi, msymbol(o) msize(normal) mcolor(red) ciopts(lcolor(red red))), vertical yline(0, lcolor(red)) levels(95 90) xlabel(none) groups(mfd_pca_peacecomp0_1sh mfd_pca_peacecomp0_1si = "PCA peace components, FD" mfd_q21_normsh mfd_q21_normsi = "UKR shouldn't join NATO, FD" mfd_q22_normsh mfd_q22_normsi = "Western security guarantees, FD" mfd_q23_normsh mfd_q23_normsi = "Russian as official language, FD"  mfd_q24_normsh mfd_q24_normsi = "Crimea as part of Russia, FD" mfd_q25_normsh mfd_q25_normsi = "Independent DNR/LNR, FD" mfd_q26_normsh mfd_q26_normsi = "Reduce UKR army size, FD" mfd_q27_normsh mfd_q27_normsi = "Voting by DNR/LNR, FD" mfd_q28_normsh mfd_q28_normsi = "UKR reject joining EU, FD" mfd_q29_normsh mfd_q29_normsi = "Zelensky stepping down, FD", labsize(small) angle(45)) aseq swapnames plotlabels("violence, short term" "violence, long term") p3(nokey) p4(nokey) p5(nokey) p6(nokey) p7(nokey) p8(nokey) p9(nokey) p10(nokey) p11(nokey) p12(nokey) p13(nokey) p14(nokey) p15(nokey) p16(nokey) p17(nokey) p18(nokey) p19(nokey) p20(nokey) graphregion (margin(15 5 1 1)) 


quietly graph export figure_a14b.jpg, replace

log close


